# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Contributor: Gennady Feldman <gena01@gmail.com>
# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-fastavro
_pkgname=fastavro
pkgver=1.9.7
pkgrel=0
pkgdesc="Fast Avro for Python"
# Tests for optional zstd and snappy codecs require
# unpackaged python modules 'zstandard' and 'python-snappy'
options="!check"
url="https://github.com/fastavro/fastavro"
# Upstream does not test 32 bit systems anymore
# Issue: https://github.com/fastavro/fastavro/issues/526
arch="all !x86 !armhf !armv7" # _tz_ tests fail
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools python3-dev cython py3-wheel"
checkdepends="py3-pytest-xdist py3-numpy"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/fastavro/fastavro/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	FASTAVRO_USE_CYTHON=1 \
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH="$(echo $PWD/build/lib.*)" python3 -m pytest -v tests
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
106b94fe069166f80d74434f562ce0d6a2fdf99d337b1d9ebdd15088ef5092e6aed478fbf9f2df8f2fffc3ed6642230e91ac1c0e6514511848371a1a42182ee5  py3-fastavro-1.9.7.tar.gz
"
